/**
 * 
 */
package com.meetingshow.meeting.service;

import java.util.ArrayList;
import java.util.List;

import com.meetingshow.common.base.dao.model.QueryStruct;
import com.meetingshow.common.base.service.BaseServiceImp;
import com.meetingshow.common.base.service.model.QueryResults;
import com.meetingshow.meeting.dao.MeetingTypeDAO;
import com.meetingshow.meeting.dao.model.MeetingTypePO;
import com.meetingshow.meeting.service.model.MeetingTypeQueryParas;
import com.meetingshow.meeting.service.util.MeetingTypeQueryParasBuilder;
import com.meetingshow.meeting.service.util.MeetingTypeServiceParas;

/**
 * @author louyi
 *
 */
public class MeetingTypeServiceImp extends BaseServiceImp implements IMeetingTypeService {

    private MeetingTypeDAO meetingTypeDAO;
    
    /**
     * @return the meetingTypeDAO
     */
    public MeetingTypeDAO getMeetingTypeDAO() {
        return meetingTypeDAO;
    }

    /**
     * @param meetingTypeDAO the meetingTypeDAO to set
     */
    public void setMeetingTypeDAO(MeetingTypeDAO meetingTypeDAO) {
        this.meetingTypeDAO = meetingTypeDAO;
    }

    @Override
    public Integer saveMeetingType(MeetingTypePO meetingTypePO) throws Exception {
        return getMeetingTypeDAO().saveMeetingType(meetingTypePO);
    }

    @Override
    public void updateMeetingType(MeetingTypePO meetingTypePO) throws Exception {
        getMeetingTypeDAO().updateMeetingType(meetingTypePO);
    }

    @Override
    public void removeMeetingType(MeetingTypePO meetingTypePO) throws Exception {
        getMeetingTypeDAO().removeMeetingType(meetingTypePO);
    }
    
    @Override
    public MeetingTypePO loadMeetingTypeById(Integer meetingTypeId)
            throws Exception {
        return getMeetingTypeDAO().loadMeetingTypeById(meetingTypeId);
    }

    @Override
    public QueryResults<MeetingTypePO> queryMeetingType(
            MeetingTypeQueryParas meetingTypeQueryParas) throws Exception {
        QueryStruct queryStruct = new QueryStruct();
        List<String> tableList = new ArrayList<String>();
        List<String> returnObjectList = new ArrayList<String>();
        
        tableList.add(MeetingTypeServiceParas.MEETING_TYPE);
        returnObjectList.add(MeetingTypeServiceParas.MEETING_TYPE);
        
        queryStruct.setTableList(tableList);
        queryStruct.setReturnObjectList(returnObjectList);
        
        queryStruct = MeetingTypeQueryParasBuilder.meetingTypeQueryBuilder(queryStruct, meetingTypeQueryParas);
        QueryResults<MeetingTypePO> queryResults = getMeetingTypeDAO().queryMeetingType(queryStruct);
        return queryResults;
    }

}
